var restitutionTableWithConsole;

function restitutionReport(text) { 
    restitutionTableWithConsole.log(text);
}

function init_restitution_table_reporting(onRowClick) {
    restitutionTableWithConsole = new TableWithConsole('#table_restitution', '#console');
    restitutionTableWithConsole.initTable([
        {"sTitle": "Nom de la zone"},
        {"sTitle": "Lat"},
        {"sTitle": "Lng"},
        {"sTitle": "Etat"},
    ],onRowClick);
}

function load_restitution_table_reporting(data) {  
    var t = []; 
    for (var i = 0; i < data.length; i++) {
        var tmp = [];
        var info = data[i].info;  
        tmp.push(info.reference);
        tmp.push(info.param.lat);
        tmp.push(info.param.lng);
        tmp.push((info.actif !== 1 ? 'Active' : 'Inactive'));
        t.push(tmp);
    }
    restitutionTableWithConsole.loadTable(t);
}




